<?php

// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;



Route::get('wechat/getUserId', 'applet/Wechat/getUserId');
Route::get('alipay/getUserId', 'applet/Alipay/getUserId');
Route::post('login/getSmsCode', 'applet/Login/getSmsCode');
Route::post('login/bindRoom', 'applet/Login/bindRoom');



Route::rule('parking/getParkingIdByAppId', 'applet/parking/getParkingIdByAppId');
Route::get('index/getData', 'applet/index/getData');

Route::any('upload', 'applet/Upload/image');
Route::group(function () {

    Route::get('community/getList', 'applet/Community/getList');
    Route::any('room/getGroupList', 'applet/Room/getGroupList');
    Route::any('room/getBuildingList', 'applet/Room/getBuildingList');
    Route::any('room/getUnitList', 'applet/Room/getUnitList');
    Route::any('room/getRoomList', 'applet/Room/getRoomList');
    Route::any('room/bind', 'applet/Room/bind');

    Route::any('person/index', 'applet/Person/index');
    Route::any('person/add', 'applet/Person/add');
    Route::any('maintenance/add', 'applet/Maintenance/add');


})->middleware([
        \app\applet\middleware\CheckLogin::class,
    ]
);
Route::group(function () {
    Route::any('user/getRoomList', 'applet/User/getRoomList');
    Route::any('user/getRoomListBill', 'applet/User/getRoomListBill');

    Route::any('bill/unPayListByRoomId', 'applet/Bill/unPayListByRoomId');
    Route::any('bill/moneySum', 'applet/Bill/moneySum');
    Route::any('pay/initiatePay', 'applet/Bill/orderPay');

})->middleware([
        \app\applet\middleware\CheckLogin::class,
        \app\applet\middleware\CheckBouseHouse::class,
    ]
);
//Route::group('applet', function () {
//    Route::get('applet/index/getData', '\app\applet\index@getData');
//

//});